package com.kakaxi.mybilibili.viewholder;

import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.kakaxi.mybilibili.R;
import com.kakaxi.mybilibili.bean.DramaRecommendItemBean;

/**
 * 番剧推荐视图持久化类
 * Created by kakaxi on 16/10/21.
 */

public class DramaRecommendViewHolder extends RecyclerView.ViewHolder {

    /** 封面图片视图 **/
    public ImageView coverImg;

    /** 标题名称文本视图 **/
    public TextView nameTxt;

    /** 详细描述文本视图 **/
    public TextView descTxt;

    public DramaRecommendViewHolder(View itemView) {
        super(itemView);
        coverImg = (ImageView) itemView.findViewById(R.id.srimg_drama_recommend_content_photo);
        nameTxt = (TextView) itemView.findViewById(R.id.txt_drama_recommend_content_name);
        descTxt = (TextView) itemView.findViewById(R.id.txt_drama_recommend_content_desc);
    }

    public void setData(DramaRecommendItemBean dramaRecommendItemBean) {
        Glide.with(coverImg.getContext()).load(dramaRecommendItemBean.getCover()).into(coverImg);
        nameTxt.setText(dramaRecommendItemBean.getTitle());
        descTxt.setText(dramaRecommendItemBean.getDesc());
    }

}
